const path = require('path');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
var target = 'umd';

module.exports = {
    mode: 'production',
    entry: path.join(__dirname,'./buildFileTask/static/temp/index.js'),
    output: {
        clean: true,
        path: path.join(__dirname, './static'),
        filename: 'online-comp.js',
        library: {
            name: 'DemoComp',
            type: target,
            umdNamedDefine: true,
            // globalObject: 'typeof self !== \'undefined\' ? self : this'
        },
        globalObject: 'typeof self !== \'undefined\' ? self : this'
    },
    // externals: ['vue'],
    module: {
        rules: [{
            test: /\.vue$/,
            loader: 'vue-loader'
        }]
    },
    plugins: [
        new VueLoaderPlugin()
    ]
}